package org.example.lazy;

import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

//@Component
public class LazyBeanWrapper2 {
    @Autowired
    //@Lazy
    private ObjectFactory<LazyBean> lazyBeanFactory;

    public void doSomething() {
        LazyBean lazyBean = lazyBeanFactory.getObject();
        lazyBean.doSomething();
    }
}
